﻿//using System.Buffers;

//namespace Acl.Messages;

///// <summary>
///// Serializer interface for messages.
///// </summary>
///// <typeparam name="T">Serialized object type</typeparam>
//public interface IDistributionMessageSerializer<T> : INatsSerialize<T>, INatsDeserialize<T>
//{
//}

///// <summary>
///// Serializer interface for messages.
///// </summary>
///// <typeparam name="T">Serialized object type</typeparam>
//public interface IDistributionMessageSerialize<in T>
//{
//    /// <summary>
//    /// Serialize value to buffer.
//    /// </summary>
//    /// <param name="bufferWriter">Buffer to write the serialized data.</param>
//    /// <param name="value">Object to be serialized.</param>
//    void Serialize(IBufferWriter<byte> bufferWriter, T value);
//}

///// <summary>
///// Deserializer interface for messages.
///// </summary>
///// <typeparam name="T">Deserialized object type</typeparam>
//public interface IDistributionMessageDeserialize<out T>
//{
//    /// <summary>
//    /// Deserialize value from buffer.
//    /// </summary>
//    /// <param name="buffer">Buffer with the serialized data.</param>
//    /// <returns>Deserialized object</returns>
//    T? Deserialize(in ReadOnlySequence<byte> buffer);
//}


//public interface IIDistributionMessageSerializerRegistry
//{
//    IDistributionMessageSerialize<T> GetSerializer<T>();

//    INatsDeserialize<T> GetDeserializer<T>();
//}

//struct DistributionMessageSerialize<T>(IDistributionMessageSerializer<T> inner ) : INatsSerializer<T>
//{
//    public T? Deserialize(in ReadOnlySequence<byte> buffer) => inner.Deserialize(buffer);

//    public void Serialize(IBufferWriter<byte> bufferWriter, T value) => inner.Serialize(bufferWriter, value);
//}